import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

//导入组件
import Login from "@/views/Login/Login.vue";
import Register from "@/views/Login/Register.vue";
import Main from "@/views/Main.vue";
import ArtCate from "@/views/Article/ArtCate.vue";
import ArtList from "@/views/Article/ArtList.vue";
import Home from "@/views/Home/Home.vue";
import UserAvatar from "@/views/User/UserAvatar.vue";
import UserPwd from "@/views/User/UserPwd.vue";
import UserInfo from "@/views/User/UserInfo.vue";

//路由规则
const routes = [
  //首页重定向
  { path: "/", redirect: '/Main' },
  { path: "/Login", component: Login },
  { path: "/Register", component: Register },
  { path: "/Main", component: Main },
  { path: "/ArtCate", component: ArtCate },
  { path: "/ArtList", component: ArtList },
  { path: "/Home", component: Home },
  { path: "/UserAvatar", component: UserAvatar },
  { path: "/UserPwd", component: UserPwd },
  { path: "/UserInfo", component: UserInfo },

]

const router = new VueRouter({
  routes
})

export default router
